# -*- coding: UTF-8 -*-
import json
def as_num(x):
    y='{:.5f}'.format(x)
    return(float(y))
if __name__ == '__main__':
    kx=[1.266690E+02,3.795236E+01
    ,1.266707E+02,3.795963E+01
    ,1.266787E+02,3.795702E+01
    ,1.266886E+02,3.796048E+01
    ,1.267043E+02,3.795435E+01
    ,1.267210E+02,3.795649E+01
    ,1.267326E+02,3.796120E+01
    ,1.267352E+02,3.796596E+01
    ,1.267478E+02,3.797328E+01
    ,1.267577E+02,3.797368E+01
    ,1.267714E+02,3.798325E+01
    ,1.267798E+02,3.798145E+01
    ,1.267906E+02,3.799833E+01
    ,1.268117E+02,3.800069E+01
    ,1.268178E+02,3.800454E+01
    ,1.268221E+02,3.800842E+01
    ,1.268230E+02,3.801695E+01
    ,1.268398E+02,3.803491E+01
    ,1.268492E+02,3.803543E+01
    ,1.268502E+02,3.803878E+01
    ,1.268548E+02,3.804083E+01
    ,1.268605E+02,3.806748E+01
    ,1.268659E+02,3.807052E+01
    ,1.268673E+02,3.808629E+01
    ,1.268768E+02,3.810255E+01
    ,1.268814E+02,3.810520E+01
    ,1.268974E+02,3.810207E+01
    ,1.269080E+02,3.811698E+01
    ,1.269220E+02,3.812085E+01
    ,1.269360E+02,3.812871E+01
    ,1.269392E+02,3.813513E+01
    ,1.269582E+02,3.813413E+01
    ,1.269636E+02,3.813670E+01
    ,1.269683E+02,3.814359E+01
    ,1.269673E+02,3.814615E+01
    ,1.269474E+02,3.815847E+01
    ,1.269508E+02,3.816373E+01
    ,1.269631E+02,3.817002E+01
    ,1.269675E+02,3.818476E+01
    ,1.269616E+02,3.819049E+01
    ,1.269749E+02,3.820035E+01
    ,1.269848E+02,3.821547E+01
    ,1.269880E+02,3.821773E+01
    ,1.269993E+02,3.821783E+01
    ,1.270134E+02,3.823577E+01
    ,1.270572E+02,3.825535E+01
    ,1.271099E+02,3.829056E+01
    ,1.271093E+02,3.829679E+01
    ,1.271246E+02,3.830085E+01
    ,1.271325E+02,3.831676E+01
    ,1.271407E+02,3.831679E+01
    ,1.271525E+02,3.830709E+01
    ,1.272424E+02,3.833414E+01
    ,1.272513E+02,3.832970E+01
    ,1.272918E+02,3.832196E+01
    ,1.272996E+02,3.831446E+01
    ,1.273059E+02,3.831900E+01
    ,1.273245E+02,3.832176E+01
    ,1.273299E+02,3.831915E+01
    ,1.273485E+02,3.833101E+01
    ,1.273618E+02,3.832652E+01
    ,1.273853E+02,3.833873E+01
    ,1.274122E+02,3.833134E+01
    ,1.274177E+02,3.832658E+01
    ,1.274507E+02,3.831437E+01
    ,1.274599E+02,3.831897E+01
    ,1.274749E+02,3.831047E+01
    ,1.275052E+02,3.830291E+01
    ,1.275238E+02,3.831005E+01
    ,1.275461E+02,3.832595E+01
    ,1.275733E+02,3.833521E+01
    ,1.276166E+02,3.833527E+01
    ,1.276190E+02,3.832633E+01
    ,1.276319E+02,3.832700E+01
    ,1.276378E+02,3.832451E+01
    ,1.276437E+02,3.832781E+01
    ,1.276598E+02,3.832629E+01
    ,1.276640E+02,3.832845E+01
    ,1.276693E+02,3.832476E+01
    ,1.276889E+02,3.832591E+01
    ,1.276943E+02,3.833481E+01
    ,1.276998E+02,3.833831E+01
    ,1.277142E+02,3.833685E+01
    ,1.277158E+02,3.833107E+01
    ,1.277353E+02,3.834162E+01
    ,1.277421E+02,3.834253E+01
    ,1.277528E+02,3.833657E+01
    ,1.277618E+02,3.833905E+01
    ,1.277690E+02,3.833717E+01
    ,1.277789E+02,3.834946E+01
    ,1.277830E+02,3.835056E+01
    ,1.277874E+02,3.834757E+01
    ,1.277981E+02,3.832423E+01
    ,1.278228E+02,3.830578E+01
    ,1.278470E+02,3.831620E+01
    ,1.278664E+02,3.831420E+01
    ,1.278775E+02,3.831799E+01
    ,1.278820E+02,3.833255E+01
    ,1.278971E+02,3.833188E+01
    ,1.279011E+02,3.832665E+01
    ,1.279337E+02,3.832246E+01
    ,1.279547E+02,3.831471E+01
    ,1.279618E+02,3.831426E+01
    ,1.279725E+02,3.832102E+01
    ,1.279856E+02,3.832222E+01
    ,1.279883E+02,3.831743E+01
    ,1.279943E+02,3.831632E+01
    ,1.280336E+02,3.831676E+01
    ,1.280351E+02,3.831493E+01
    ,1.280328E+02,3.831209E+01
    ,1.280408E+02,3.830983E+01
    ,1.280615E+02,3.830896E+01
    ,1.280880E+02,3.832045E+01
    ,1.281134E+02,3.833911E+01
    ,1.281177E+02,3.833926E+01
    ,1.281273E+02,3.833345E+01
    ,1.281347E+02,3.833436E+01
    ,1.281437E+02,3.834313E+01
    ,1.281532E+02,3.834604E+01
    ,1.281563E+02,3.834459E+01
    ,1.281579E+02,3.834930E+01
    ,1.281852E+02,3.835756E+01
    ,1.282425E+02,3.839655E+01
    ,1.282784E+02,3.843136E+01
    ,1.282973E+02,3.846319E+01
    ,1.283089E+02,3.850205E+01
    ,1.283119E+02,3.853177E+01
    ,1.283048E+02,3.856978E+01
    ,1.283108E+02,3.857533E+01
    ,1.283069E+02,3.858932E+01
    ,1.283102E+02,3.859588E+01
    ,1.283252E+02,3.859828E+01
    ,1.283450E+02,3.861209E+01
    ,1.283657E+02,3.862874E+01
    ,1.286491E+02,3.864966E+01
    ,1.322649E+02,3.779738E+01
    ,1.323386E+02,3.688045E+01
    ,1.291532E+02,3.465635E+01
    ,1.280222E+02,3.296471E+01
    ,1.244013E+02,3.236076E+01
    ,1.243188E+02,3.808004E+01
    ,1.247703E+02,3.807776E+01
    ,1.249209E+02,3.789969E+01
    ,1.249792E+02,3.775651E+01
    ,1.250809E+02,3.767613E+01
    ,1.254300E+02,3.765757E+01
    ,1.258495E+02,3.774621E+01
    ,1.261379E+02,3.771138E+01
    ,1.261605E+02,3.771941E+01
    ,1.261861E+02,3.774860E+01
    ,1.261895E+02,3.779722E+01
    ,1.261937E+02,3.781716E+01
    ,1.262223E+02,3.783134E+01
    ,1.262373E+02,3.783334E+01
    ,1.262760E+02,3.782725E+01
    ,1.262934E+02,3.782712E+01
    ,1.264131E+02,3.784540E+01
    ,1.264273E+02,3.784295E+01
    ,1.264483E+02,3.783378E+01
    ,1.264619E+02,3.781733E+01
    ,1.265220E+02,3.779589E+01
    ,1.265409E+02,3.778685E+01
    ,1.265671E+02,3.776901E+01
    ,1.265786E+02,3.776485E+01
    ,1.266015E+02,3.776681E+01
    ,1.266202E+02,3.778109E+01
    ,1.266304E+02,3.778358E+01
    ,1.266573E+02,3.778361E+01
    ,1.266613E+02,3.778863E+01
    ,1.266602E+02,3.779866E+01
    ,1.266661E+02,3.782762E+01
    ,1.266725E+02,3.783377E+01
    ,1.266869E+02,3.783923E+01
    ,1.266875E+02,3.784853E+01
    ,1.266816E+02,3.787335E+01
    ,1.266816E+02,3.790034E+01
    ,1.266868E+02,3.791211E+01
    ,1.266861E+02,3.791559E+01
    ,1.266772E+02,3.791914E+01
    ,1.266727E+02,3.792684E+01
    ,1.266677E+02,3.794405E+01
    ,1.266690E+02,3.795236E+01
    ]
    geo={
        "type": "FeatureCollection",
        "name": "HG",
        "crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } },
        "features": [
        { "type": "Feature", "properties": {  }, "geometry": { "type": "MultiPolygon", "coordinates": [ [] ] } }
        ]
        }
    result=[as_num(num) for num in kx]
    coors=[]
    coor=[]
    for i,num in enumerate(result):
        if (i % 2) == 0:
            coor.append(num)
        else:
            coor.append(num)
            coors.append(coor)
            coor=[]
    geo["features"][0]["geometry"]["coordinates"][0].append(coors)
    file_handle=open(r'D:\data_dir2\hg.txt',mode='w')
    file_handle.write(json.dumps(geo))
    print("success")
